#!/bin/bash

# 替换brew.git:
echo "set homebrew"
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

# 替换homebrew-core.git:
echo "set homebrew-core"
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git

# 应用生效
echo "homebrew udate"
brew update

# 替换homebrew-bottles:
echo 'set HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles in .bash_profile'